#include<stdio.h>
#include<string.h>

void clearStr(char s[])
{
    int i=0;
    while(s[i]!='\0')
    {
        s[i]='\0';
        i++;
    }
}

int DelFile(char HeaderName[], int num)
{
    char name[30], strNum[10];
    clearStr(name);
    strcat(name, HeaderName);
    sprintf(strNum, "%d", num);
    strcat(name, strNum);
    printf("%s\n", name);
    remove( name );
    return 1;

}

int ReadNum()
{
    FILE *fp;
    if((fp = fopen("numb.txt", "r")) == NULL)
    {
        printf("\nCan not open file numb.txt");
        exit(1);
    }
    int num;
    fscanf(fp, "%d", &num);
    fclose(fp);
    return num;
}

void resetNumb()
{
    FILE *fp;
    if ((fp = fopen("numb.txt", "w"))== NULL)
    {
        printf("\nCan not write to file numb.txt");
    }
    fprintf(fp, "1");
    fclose(fp);
}

int resetMaps()
{
    int num, i;
    num = ReadNum();
    for (i=1; i<=num; i++)
    {
        DelFile("no", i);
    }
    resetNumb;
}

int main()
{
    resetMaps();
}
